package sctu.edu.java.year2016.team04.luoxinghua.day20160603.ThreeArray;

import javax.swing.text.html.HTMLDocument;
import java.util.*;

/**
 * Created by 落叶的思恋 on 2016/6/22.
 */
public class Map {
    java.util.Map<String, String> map = new HashMap<>();
    Scanner scanner = new Scanner(System.in);
    String key;
    String vlue;

    class  one{
        protected void printf(){
            while (true) {
                System.out.println("你要加入数据库的问题的的关键词");
                String HowMany = scanner.nextLine();
                System.out.println("你的加入的答案是");
                String Problem = scanner.nextLine();
                map.put(HowMany,Problem);
                System.out.print("你是否还要添加（输入：“是”“否”）");
                String s = scanner.nextLine();
                if (s.equals("否")) {
                    break;
                }
            }
        System.out.println(map);
    }}

    protected void map() {
        for (int i=0; i<3;i++) {
            String key = scanner.nextLine();
            String vlue = scanner.nextLine();
            map.put(key, vlue);
        }
    System.out.println(map);
}
     /*  map1.put( "卡顿"," 我是第一个");
       map1.put( "时常死机"," I am the second 死机");
       map1.put( "下一个"," I am the three 下一个");
       map1.put("在下一个", "我是最后一个");
       String sa=scanner.nextLine();
       String ser=scanner.nextLine();
       for (int i=1;i<3;i++)
           map.put(sa,ser);
       System.out.println(map1);
       System.out.println("you want search problem");
       Scanner scanner=new Scanner(System.in);
       String ss=scanner.nextLine();
       System.out.println(""+map.get(ss));
       System.out.println("you want insert number");
       String HowMany=scanner.nextLine();
       System.out.println("你的加入的答案是");
       String Problem=scanner.nextLine();
       map.put(HowMany,Problem);
       System.out.println("" +map.get(HowMany));

   }
   /*protected void set(){
       Set<String> set=new HashSet<String>();
       Set<String> set1=new HashSet<String>();
       Set<String> set2=new HashSet<String>();
       set.add("寻找最美男子");
       set.add("在沙发找到一位");
       set.add("one");
       set.add("two");
       set.add("three");
       set.add("four");
       set.add("one");
       set1.add("one");
       set2.add("one two three");
       System.out.println("set size is " + set.size());
       System.out.println("Whether it is empty:" + set.isEmpty());
       set.removeAll(set1);
       System.out.println("after set.removeAll(set1)  is" + set);
       set.remove(1);
       System.out.println("set.remove(1)="+set);
       System.out.println(" " + set);
       set.containsAll(set2);
*/

   /* protected void List(){
  List<String> list=new  LinkedList<String>();
        list.add("zhangsan");
        list.add("lisi");
        list.add("wangwu");
        list.add("zhaoqian");
        System.out.println(list);
        System.out.println("     list.get(1)= " + list.get(1));
        System.out.println("list.subList(1, 2)= " + list.subList(1, 3));
        list.set(2, "change");
        System.out.println(" list.set(1,change)= "+list );
        list.listIterator();
    }*/
}
